<?php

class View_Helper_DropDownMenu extends Model3_View_Helper
{

    public function operationControllers($em, $currentController)
    {
        $userRepository = $em->getRepository('DefaultDb_Entities_User');
        $controllers = $userRepository->getActiveOperationControllers();
        ?>
        <div class="btn-group uppercase">
            <button type="button" class="btn btn-primary dropdown-toggle uppercase" data-toggle="dropdown">
                <?php echo $currentController->getFullName(); ?> <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" role="menu">
                <?php foreach ($controllers as $controller) : ?>
                    <li>
                        <a href="<?php
                        echo $this->_view->url(array('id' => $controller->getId()));
                        ?>">
                            <?php echo $controller->getFullName(); ?>
                        </a>
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
        <?php
    }

}
